﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Maknys.Consultator.ServiceContracts;
using Maknys.Consultator.DataContracts;
using Maknys.Consultator.DomainModel;
using Maknys.Consultator.Repositories;
using System.Collections;

namespace Maknys.Consultator.Services
{
    public class EditingService : IEditingService
    {
        private readonly IEditingRepository editingRepository;

        public EditingService()
        {
            editingRepository = new EditingRepository();
        }

        public void ReadAll(ArrayList infoList)
        {
            editingRepository.ShowAll(infoList);
        }

        public void MakeNewElement(string pId, string value)
        {
            editingRepository.Create(pId, value);
        }

        public void EditElement(string id, string pId, string value)
        {
            editingRepository.Edit(id, pId, value);
        }

        public void DeleteElement(string id)
        {
            editingRepository.Remove(id);
        }

        public void MakeSentence(string sentence, ref string id, ref string pId, ref string value)
        {
            editingRepository.MakeSentence(sentence, ref id, ref pId, ref value);
        }

    }
}
